import React from 'react'
import { Navigate } from 'react-router-dom'
import * as api from '../api/index'
function HocLogin(Com) {
  return(props) =>{
      let tokens = JSON.parse(window.localStorage.getItem('tokens'));
      if(!tokens){
        return <Navigate to={'/login'}></Navigate>
      }
      return <Com {...props}></Com>
  }
}

export default HocLogin